<?php
class BrandCloud extends CWidget
{
	public $postParams=array();
	public $config=array();
	
	public function run()
  	{?>
		<div>
				<div class="title_offer pb20 pt20">Brand<span class="helv_neue_thin">Cloud</span></div>
					<div>
						
						<?php 
							$Brands = Vendor::getList("ALL-RAND");
							$brandnameCSS = array(0=>'font-weight:bold;font-size:18px;color:#C14B23',1=>'font-weight:normal;font-size:17px;color:#E99F86');
							$brandtitleCSS = array(0=>'color:#E99F86;font-weight:bold;',1=>'color:#C14B23');
							$brandofferCSS = array(0=>'color:#C14B23',1=>'color:#E99F86;font-weight:bold;');
							if (count($Brands)<20)
							{
								
								for ($i=0;$i<3;$i++){
								foreach ($Brands as $brand)
								{
									$brandcssRand = array_rand($brandnameCSS);
									echo "<a style='$brandnameCSS[$brandcssRand]' href='".ApplicationConfig::getURL("", "site", "brands",array("id"=>$brand->vendorID))."'> <b>".$brand->vendor_name."</b></a> "." <span style='$brandofferCSS[$brandcssRand]'>"."</span> ";
									//$job = Job::model()->getModel('VENDOR-RAND-ID',array('vendorID'=>$brand->vendorID));
									//if (!empty($job))
										//echo " <span style='$brandtitleCSS[$brandcssRand]'>".$job->job_title."</span> ";
									//$offer = Offer::model()->getModel('VENDOR-RAND-ID',array('vendorID'=>$brand->vendorID));
									//if (!empty($offer))
										//echo " <span style='$brandofferCSS[$brandcssRand]'>".$offer->offer_title."</span> ";
								}
								}
								
							}
							else 
							{
								foreach ($Brands as $brand)
								{
									echo "<a href='".ApplicationConfig::getURL("", "site", "brands",array("id"=>$brand->vendorID))."'> <b>".$brand->vendor_name."</b></a> ".ApplicationConfig::app()->params['vendor_params']['type'][$brand->vendor_type]." ";
									//$job = Job::model()->getModel('VENDOR-RAND-ID',array('vendorID'=>$brand->vendorID));
									//if (!empty($job))
										//echo " ".$job->job_title." ";
									//$offer = Offer::model()->getModel('VENDOR-RAND-ID',array('vendorID'=>$brand->vendorID));
									//if (!empty($offer))
										//echo $offer->offer_title." ";
								}
							}
						
						?>	
					
					</div>
				</div>
		  		
  	<?php }
}
?>  
 